//
//  InputControlM.h
//  
//  jhf
//
//  Created by Mac on 2020/7/21.
//

#import <Foundation/Foundation.h>
#import "ViewControlM.h"

#define VERIFY_ALL_NUM @"0123456789"
#define VERIFY_ALL_NUM_POINT @"0123456789."
#define VERIFY_ALL_NUM_X @"0123456789xX"
#define VERIFY_ALL_ALPHA @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
#define VERIFY_ALL_ALPHA_NUM @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

//定义枚举类型
typedef enum _SKYState {
    CooperInputTypeDefault = 0,
    CooperInputTypeNumber,
    CooperInputTypeMoney,
    CooperInputTypeIdCard,
    CooperInputTypePhoneNumber
} CooperInputType;

NS_ASSUME_NONNULL_BEGIN

@interface InputControlM : ViewControlM

// 显示
@property (nonatomic, copy) NSString *textStr;
@property (nonatomic, strong) UIFont *textStrFont;
@property (nonatomic, copy) NSString *textColorHex;

@property (nonatomic, assign) BOOL editEnable;

@property (nonatomic, assign) UITextFieldViewMode clearModel;

// 富文本
@property (nonatomic, assign) NSTextAlignment textTextAlignment;

// 键盘
@property (nonatomic, assign) UIKeyboardType keyboardType;
@property (nonatomic, assign) BOOL secureTextEntry;

// 占位
@property (nonatomic, copy) NSString *placeholderStr;
@property (nonatomic, strong, nullable) UIFont *placeholderFont;
@property (nonatomic, copy, nullable) NSString *placeholderColorHex;

// text view
@property (nonatomic, assign) BOOL scrollEnabled;

- (void)controlTextField:(UITextField *)inputV;

- (void)controlTextView:(UITextView *)inputV;

+ (InputControlM *)defaultInputText:(NSString *)text;

// MARK: - 功能验证
// 允许出现的字符串
@property (nonatomic, copy) NSString *allowStrings;

// 长度限制
@property (nonatomic, assign) NSInteger maxLength;

// 金额长度限制
@property (nonatomic, assign) NSInteger moneyLeftMaxLength;
@property (nonatomic, assign) NSInteger moneyRightMaxLength;

///  特殊键盘设置、已经数据验证
@property (nonatomic, assign) CooperInputType inputType;

// 是不是数字
@property (nonatomic, assign) BOOL isNumber;

// 是不是金额
@property (nonatomic, assign) BOOL isMoney;

// 是不是身份证号码
@property (nonatomic, assign) BOOL isIdCard;

// 是不是手机号
@property (nonatomic, assign) BOOL isPhoneNumber;

// 是不是银行卡
@property (nonatomic, assign) BOOL isBankCardNumber;

// 是不是数字和字母
@property (nonatomic, assign) BOOL isAlphaNum;

// 是不是邮箱
@property (nonatomic, assign) BOOL isEmail;

// 是不是密码
@property (nonatomic, assign) BOOL isPwd;


@property (nonatomic, strong) UIView *inputView;


@end

NS_ASSUME_NONNULL_END
